rpc.exports = {
    anticontent: function (time, device_id) {
        var enc = ''
        Java.perform(function () {
            //-----------
            // 要执行特定的函数或操作
            // console.log('time:', time, "device_id", device_id)
            let DeviceNative = Java.use("com.xunmeng.pinduoduo.secure.DeviceNative");
            const ActivityThread = Java.use("android.app.ActivityThread");
            const currentApplication = ActivityThread.currentApplication();
            const context = currentApplication.getApplicationContext();
            if (device_id) {
                enc = DeviceNative["info3"](context, time, device_id);
            } else {
                enc = DeviceNative["info2"](context, time);
            }
            // console.log('enc:' + enc)
            //-----------
        });
        return enc
    },
    encryptdevice: function (device_info) {
        var enc = ''
        Java.perform(function () {
            //-----------
            // 要执行特定的函数或操作
            try {
                var HashMap = Java.use('java.util.HashMap').$new();
                Object.keys(device_info).forEach(function (key) {
                    HashMap.put(key, device_info[key]);
                })
                let currentTime = Java.use("java.lang.System").currentTimeMillis();
                let NewBaseApplication = Java.use("com.xunmeng.pinduoduo.putils.NewBaseApplication");
                let context = NewBaseApplication.getContext();
                let C25565al = Java.use("com.xunmeng.pinduoduo.secure.al");
                // enc = C25565al.a(context, HashMap);

                let str5_obj = {
                    "start_by_user": "true",
                    "install_token": "4bdbe928-88a9-6244-b9d3-cbd8b06cdd8e",
                    "app_type": "",
                    "app_version": "7.8.0",
                    "device_id": "",
                    "tmp_id": "",
                    "clipboard_md5": "",
                    "commitid": "bf793aa528affe1b01408904fabc55be5b816173_pdd_patch",
                    "uuid": "484bcee8-d581-4725-a2ba-88a926db7fa",
                    "scene": "1",
                    "meta_type": "all",
                    "p46": "1714965410516",
                    "imei_shown": "false",
                    "instrumentation_chain": "android.app.Instrumentation",
                    "known_device": "1",
                    "oaid": "",
                    "version": "205",
                    "wallpaper_md5": "",
                    "instrumentation": "android.app.Instrumentation",
                    "kernelVersion": "",
                    "ringtone": "",
                    "alarm": "",
                    "notification": "",
                    "p29": "",
                    "p30": "",
                    "p72": "1",
                    "input_mathod": "com.baidu.input_oppo",
                    "secure_lock": "0",
                    "ip_list": "",
                    "connected_wifi": "",
                    "wifi": "",
                    "development_enabled": "1",
                    "simState": "5",
                    "totalcapacity": "231603436032",
                    "availablecapacity": "118671587328",
                    "totalmemory": "12963949056",
                    "psno": "",
                    "adb_enabled": "1",
                    "mediaDrm": "",
                    "sn_1": "",
                    "sn_2": "",
                    "sn_3": "unknown",
                    "brightness": "118",
                    "availablememory": "4910166784",
                    "imei_permission": "-1",
                    "net_type": "MOBILE",
                    "fk_result": "{\"vInfo\":{\"exits\":0,\"id\":\"\"},\"antInfo\":{\"exits\":0}}",
                    "machine_arch": "ARM",
                    "arp_info": "",
                    "user_phonename": "一加 Ace 3",
                    "process_id": "4011",
                    "cid_inner": "",
                    "cid": "",
                    "input_device": "",
                    "wifi_config": "",
                    "target_version": "30",
                    "user_env2": "",
                    "foreground": "true",
                    "currentTime": currentTime
                }
                let cookie = '';
                let uid = '';
                let pddid = '';
                let str5 = Object.keys(str5_obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(str5_obj[key])}`).join('&');
                let SecureNative = Java.use("com.xunmeng.pinduoduo.secure.SecureNative");
                enc = SecureNative['ng2'](context, uid, cookie, pddid, null, str5, currentTime, 'all');
            } catch (e) {
                enc = `error ${e.stack}`;
            }

        });
        return enc
    }
    // encryptdevice: function (device_info) {
    //     var enc = ''
    //     Java.perform(function () {
    //         //-----------
    //         // 要执行特定的函数或操作
    //         try {
    //             let NewBaseApplication = Java.use("com.xunmeng.pinduoduo.putils.NewBaseApplication");
    //         let context = NewBaseApplication.getContext();
    //         let uid = '';
    //         let cookie = device_info.cookie;
    //         let pddid = device_info.pddid;
    //         let currentTime = Java.use("java.lang.System").currentTimeMillis();
    //         let str5_obj = {
    //             "start_by_user": device_info.start_by_user,
    //             "install_token": device_info.install_token,
    //             "app_type": '',
    //             "app_version": device_info.app_version,
    //             "device_id": '',
    //             "tmp_id": '',
    //             "clipboard_md5": '',
    //             "commitid": device_info.commitid,
    //             "uuid": device_info.uuid,
    //             "scene": '1',
    //             "meta_type": 'all',
    //             "p46": device_info.p46,
    //             "imei_shown": 'false',
    //             "instrumentation_chain": "android.app.Instrumentation",
    //             "known_device": device_info.known_device,
    //             "oaid": device_info.oaid,
    //             "version": device_info.version,
    //             "wallpaper_md5": '',
    //             "instrumentation": "android.app.Instrumentation",
    //             "kernelVersion": "",
    //             "ringtone": "",
    //             "alarm": "",
    //             "notification": "",
    //             "p29": "",
    //             "p30": device_info.p30,
    //             "p72": "1",
    //             "input_mathod": device_info.input_mathod,
    //             "secure_lock": device_info.secure_lock,
    //             "ip_list": device_info.ip_list,
    //             "connected_wifi": "",
    //             "wifi": "",
    //             "development_enabled": "1",
    //             "simState": device_info.ip_list,
    //             "totalcapacity": device_info.totalcapacity,
    //             "availablecapacity": device_info.availablecapacity,
    //             "totalmemory": device_info.totalmemory,
    //             "psno": "",
    //             "adb_enabled": device_info.adb_enabled,
    //             "mediaDrm": device_info.mediaDrm,
    //             "sn_1": "",
    //             "sn_2": "",
    //             "sn_3": "unknown",
    //             "brightness": "0",
    //             "availablememory": device_info.availablememory,
    //             "imei_permission": device_info.imei_permission,
    //             "net_type": "MOBILE",
    //             "fk_result": "{\"vInfo\":{\"exits\":0,\"id\":\"\"},\"antInfo\":{\"exits\":0}}",
    //             "machine_arch": "ARM",
    //             "arp_info": "",
    //             "user_phonename": device_info.user_phonename,
    //             "process_id": device_info.process_id,
    //             "cid_inner": "",
    //             "cid": "",
    //             "input_device": device_info.input_device,
    //             "wifi_config": "",
    //             "target_version": "30",
    //             "user_env2": device_info.user_env2,
    //             "foreground": "true",
    //             "currentTime": currentTime
    //         }
    //         let str5 = Object.keys(str5_obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(str5_obj[key])}`).join('&');
    //         let SecureNative = Java.use("com.xunmeng.pinduoduo.secure.SecureNative");
    //         enc = SecureNative['ng2'](context, uid, cookie, pddid, null, str5, currentTime, 'all');
    //         } catch (e) {
    //             enc = e.stack;
    //         }
    //
    //     });
    //     return enc
    // }
}